package de.argh.codebook;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Handles requests for the application login page.
 */
@Controller
public class LoginController {

  /**
   * Provides the view for the user login
   */
  @RequestMapping(value = "/login", method = RequestMethod.GET)
  public String login() {
    return "login";
  }
  
  @RequestMapping(value="/login", params = {"failed=t"}, method = RequestMethod.GET)
  public String loginerror(Model model) {
 
    model.addAttribute("error", "true");
    return "login";
 
  }
}